package com.extsci.webmail.web.client;


import com.extsci.webmail.common.entity.userinfo.Company;
import com.extsci.webmail.common.entity.userinfo.SysUser;
import com.extsci.webmail.web.client.hystrix.UserServiceHystrix;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 获取当前登录用户基本信息
 * @author ccoke
 */
@FeignClient(value = "yl-user-admin", fallback = UserServiceHystrix.class)
public interface UserServiceClient {
    /**
     * 根据用户名获取用户信息
     */
    @GetMapping(value = "/api/user/info")
    List<SysUser> getUserInfo(@RequestParam("username") String username);

    /**
     * 根据公司ID获取公司信息
     */
    @GetMapping(value = "/api/company")
    Company getCompanyById(@RequestParam("id") Integer id);

}
